#include "RectangleWidget.h"
#include "Render/Widget/RenderWidgets.h"

void RRectangleWidget::PaintSelf(uint16_t& InZOrder,const SRect& InClipArea)
{
    auto RenderRectWidget=std::make_shared<SRenderRectWidget>();
    RenderRectWidget->Rect=SRect(PresentAbsPosition,PresentSize);
    RenderRectWidget->ClipRect=InClipArea;
    RenderRectWidget->ZOrder=InZOrder;
    InZOrder++;

    RenderRectWidget->bFill=Fill.Get();
    RenderRectWidget->FillColor=FillColor.Get();
    RenderRectWidget->BorderSize=CMath::Max(0.f,BorderSize.Get()) ;
    RenderRectWidget->BorderColor=BorderColor.Get();
    RenderRectWidget->Radius=Radius.Get();

    if(!RenderRectWidget->bFill 
        && RenderRectWidget->BorderSize<=0)
    {
        return;
    }

    PaintRenderWidget(
        RenderRectWidget);

}

